package com.ss.main;

import static com.ss.constant.Constant.*;

import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

/**
 * 游戏的主窗口类，关于游戏中绘制的所有内容都在此类中完成
 * 继承Frame类，可实现窗口功能
 */
public class GameFrame extends Frame {
    /**
     * 构造方法中初始化参数
     */
    public GameFrame(){
        setVisible(true);
        setSize(FRAME_WIDTH,FRAME_HEIGHT);
        setTitle(FRAME_TITLE);
        setLocation(FRAME_X,FRAME_Y);
        setResizable(false);

        addWindowListener(new WindowAdapter() {
            @Override
            public void windowClosing(WindowEvent windowEvent) {
                System.exit(0);
            }
        });
    }

}
